import React, { Component } from 'react';
import { Button, Form } from 'antd';
import { FormInstance } from 'antd/lib/form';
import './addUserItem.less';
interface IPops {
  submit?: () => void;
  reset?: () => void;
}
export default class AddUserItem extends Component<IPops> {
  formRef = React.createRef<FormInstance>();
  render() {
    return (
      <div className="addUserItem">
        <Form ref={this.formRef} name="control-ref">
          {this.props.children}
          <div>
            <Button
              type="primary"
              style={{
                marginRight: 10,
                backgroundColor: '#0C41FD',
                width: 100,
              }}
              onClick={this.props.submit}
            >
              确定
            </Button>
            <Button onClick={()=>{
              this.formRef.current!.resetFields();
            }}>重置</Button>
          </div>
        </Form>
      </div>
    );
  }
}
